/* @(#)/C:\\APEP3\\JavaSourceOutput\DownloadFileVersionBase.java    V1.0
 *
 * Project: APEP 
 *
 * Modify Information:
 * =============================================================================
 *   Author       Date       Description
 *   ------------ ---------- ---------------------------------------------------
 *       {CREATE_TIME} First release
 *
 * Copyright Notice:
 * =============================================================================
 *    Copyright (c) 2001-2007 Auto-Parts E-Procurement Co., Ltd. 
 *        No.251-1 Wuning Road, Shanghai, 200063, China All rights reserved.
 *
 *    This software is the confidential and proprietary information of
 *        Auto-Parts E-Procurement Co., Ltd. ("Confidential Information").
 *        You shall not disclose such Confidential Information and shall use it
 *        only in accordance with the terms of the license agreement you entered
 *        into with APEP.
 *
 * Warning:
 * =============================================================================
 *   
 * 
 */

package com.apep.gw.data;

import java.util.*;

import framework.core.*;
/*
	Author    :
	CreateTime:{CREATE_TIME}
*/
public class DownloadFileVersionBase extends Table 
{
public static final String TABLE_NAME = "T_DOWNLOADFILE_VERSION";

private static final String BACKUP_TABLE_NAME = "T_DOWNLOADFILE_VERSION_BACKUP";

private static final String BACKUP_SEQ_NAME = "S_DOWNLOADFILE_VERSION_BACKUP";


public static final String ID = "ID";

public static final String FILE_TYPE = "FILE_TYPE";

public static final String FILE_NAME = "FILE_NAME";

public static final String FILE_LENGTH = "FILE_LENGTH";

public static final String VERSION = "VERSION";

public static final String MAJOR = "MAJOR";

public static final String MINOR = "MINOR";

public static final String REVISION = "REVISION";

public static final String SERVER_URL = "SERVER_URL";

public static final String LOCAL_SAVE_PATH = "LOCAL_SAVE_PATH";

public static final String STATUS = "STATUS";

public static final String CREATE_USER_ID = "CREATE_USER_ID";

public static final String CREATE_USER = "CREATE_USER";

public static final String CREATE_TIME = "CREATE_TIME";

public static final String LAST_UPDATE_USER_ID = "LAST_UPDATE_USER_ID";

public static final String LAST_UPDATE_USER = "LAST_UPDATE_USER";

public static final String LAST_UDATE_TIME = "LAST_UDATE_TIME";


public static Vector m_fields = null;


private String m_ID = ""; //ID

private String m_FILE_TYPE = ""; //�ļ�����

private String m_FILE_NAME = ""; //�ļ����

private int m_FILE_LENGTH = Value.NULL_INT;  //�ļ���С

private String m_VERSION = ""; //�汾��

private int m_MAJOR = Value.NULL_INT;  //��汾��

private int m_MINOR = Value.NULL_INT;  //�ΰ汾��

private int m_REVISION = Value.NULL_INT;  //���а汾��

private String m_SERVER_URL = ""; //������·��

private String m_LOCAL_SAVE_PATH = ""; //���ر���·��

private String m_STATUS = ""; //�Ƿ���Ч

private String m_CREATE_USER_ID = ""; //���������

private String m_CREATE_USER = ""; //������

private String m_CREATE_TIME = ""; //����ʱ��

private String m_LAST_UPDATE_USER_ID = ""; //����޸������

private String m_LAST_UPDATE_USER = ""; //����޸���

private String m_LAST_UDATE_TIME = ""; //����޸�ʱ��



	public String getId()
	{
	    return m_ID;
	}
	public void  setId(String v)
	{
		if(getId().equals(v)) return ;
		m_ID = v ;
		markDirty(ID);
	}

	public String getFileType()
	{
	    return m_FILE_TYPE;
	}
	public void  setFileType(String v)
	{
		if(getFileType().equals(v)) return ;
		m_FILE_TYPE = v ;
		markDirty(FILE_TYPE);
	}

	public String getFileName()
	{
	    return m_FILE_NAME;
	}
	public void  setFileName(String v)
	{
		if(getFileName().equals(v)) return ;
		m_FILE_NAME = v ;
		markDirty(FILE_NAME);
	}

	public int getFileLength()
	{
	    return m_FILE_LENGTH;
	}
	public void  setFileLength(int v)
	{
		if(getFileLength()==v) return ;
		m_FILE_LENGTH = v ;
		markDirty(FILE_LENGTH);
	}

	public String getVersion()
	{
	    return m_VERSION;
	}
	public void  setVersion(String v)
	{
		if(getVersion().equals(v)) return ;
		m_VERSION = v ;
		markDirty(VERSION);
	}

	public int getMajor()
	{
	    return m_MAJOR;
	}
	public void  setMajor(int v)
	{
		if(getMajor()==v) return ;
		m_MAJOR = v ;
		markDirty(MAJOR);
	}

	public int getMinor()
	{
	    return m_MINOR;
	}
	public void  setMinor(int v)
	{
		if(getMinor()==v) return ;
		m_MINOR = v ;
		markDirty(MINOR);
	}

	public int getRevision()
	{
	    return m_REVISION;
	}
	public void  setRevision(int v)
	{
		if(getRevision()==v) return ;
		m_REVISION = v ;
		markDirty(REVISION);
	}

	public String getServerUrl()
	{
	    return m_SERVER_URL;
	}
	public void  setServerUrl(String v)
	{
		if(getServerUrl().equals(v)) return ;
		m_SERVER_URL = v ;
		markDirty(SERVER_URL);
	}

	public String getLocalSavePath()
	{
	    return m_LOCAL_SAVE_PATH;
	}
	public void  setLocalSavePath(String v)
	{
		if(getLocalSavePath().equals(v)) return ;
		m_LOCAL_SAVE_PATH = v ;
		markDirty(LOCAL_SAVE_PATH);
	}

	public String getStatus()
	{
	    return m_STATUS;
	}
	public void  setStatus(String v)
	{
		if(getStatus().equals(v)) return ;
		m_STATUS = v ;
		markDirty(STATUS);
	}

	public String getCreateUserId()
	{
	    return m_CREATE_USER_ID;
	}
	public void  setCreateUserId(String v)
	{
		if(getCreateUserId().equals(v)) return ;
		m_CREATE_USER_ID = v ;
		markDirty(CREATE_USER_ID);
	}

	public String getCreateUser()
	{
	    return m_CREATE_USER;
	}
	public void  setCreateUser(String v)
	{
		if(getCreateUser().equals(v)) return ;
		m_CREATE_USER = v ;
		markDirty(CREATE_USER);
	}

	public String getCreateTime()
	{
	    return m_CREATE_TIME;
	}
	public void  setCreateTime(String v)
	{
		if(getCreateTime().equals(v)) return ;
		m_CREATE_TIME = v ;
		markDirty(CREATE_TIME);
	}

	public String getLastUpdateUserId()
	{
	    return m_LAST_UPDATE_USER_ID;
	}
	public void  setLastUpdateUserId(String v)
	{
		if(getLastUpdateUserId().equals(v)) return ;
		m_LAST_UPDATE_USER_ID = v ;
		markDirty(LAST_UPDATE_USER_ID);
	}

	public String getLastUpdateUser()
	{
	    return m_LAST_UPDATE_USER;
	}
	public void  setLastUpdateUser(String v)
	{
		if(getLastUpdateUser().equals(v)) return ;
		m_LAST_UPDATE_USER = v ;
		markDirty(LAST_UPDATE_USER);
	}

	public String getLastUdateTime()
	{
	    return m_LAST_UDATE_TIME;
	}
	public void  setLastUdateTime(String v)
	{
		if(getLastUdateTime().equals(v)) return ;
		m_LAST_UDATE_TIME = v ;
		markDirty(LAST_UDATE_TIME);
	}



	public String viewId(DBConnection con) throws Exception
	{
		return Value.view(getId());
	}

	public String viewFileType(DBConnection con) throws Exception
	{
		return Value.view(getFileType());
	}

	public String viewFileName(DBConnection con) throws Exception
	{
		return Value.view(getFileName());
	}

	public String viewFileLength(DBConnection con) throws Exception
	{
		return Value.view(getFileLength());
	}

	public String viewVersion(DBConnection con) throws Exception
	{
		return Value.view(getVersion());
	}

	public String viewMajor(DBConnection con) throws Exception
	{
		return Value.view(getMajor());
	}

	public String viewMinor(DBConnection con) throws Exception
	{
		return Value.view(getMinor());
	}

	public String viewRevision(DBConnection con) throws Exception
	{
		return Value.view(getRevision());
	}

	public String viewServerUrl(DBConnection con) throws Exception
	{
		return Value.view(getServerUrl());
	}

	public String viewLocalSavePath(DBConnection con) throws Exception
	{
		return Value.view(getLocalSavePath());
	}

	public String viewStatus(DBConnection con) throws Exception
	{
		return Value.view(getStatus());
	}

	public String viewCreateUserId(DBConnection con) throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewCreateUser(DBConnection con) throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateTime(DBConnection con) throws Exception
	{
		return Value.view(getCreateTime());
	}

	public String viewLastUpdateUserId(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUserId());
	}

	public String viewLastUpdateUser(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUser());
	}

	public String viewLastUdateTime(DBConnection con) throws Exception
	{
		return Value.view(getLastUdateTime());
	}



protected DownloadFileVersionBase()
{
}

public void fill(DownloadFileVersionPageData pageData) throws Exception
{

	if(pageData.getId()!=null)
	{	
		setId(pageData.getId());
	}

	if(pageData.getFileType()!=null)
	{	
		setFileType(pageData.getFileType());
	}

	if(pageData.getFileName()!=null)
	{	
		setFileName(pageData.getFileName());
	}

	if( pageData.getFileLength()!=null && 
	   !pageData.getFileLength().equals(""))
	{	
		setFileLength(Integer.parseInt(pageData.getFileLength()));
	}

	if(pageData.getVersion()!=null)
	{	
		setVersion(pageData.getVersion());
	}

	if( pageData.getMajor()!=null && 
	   !pageData.getMajor().equals(""))
	{	
		setMajor(Integer.parseInt(pageData.getMajor()));
	}

	if( pageData.getMinor()!=null && 
	   !pageData.getMinor().equals(""))
	{	
		setMinor(Integer.parseInt(pageData.getMinor()));
	}

	if( pageData.getRevision()!=null && 
	   !pageData.getRevision().equals(""))
	{	
		setRevision(Integer.parseInt(pageData.getRevision()));
	}

	if(pageData.getServerUrl()!=null)
	{	
		setServerUrl(pageData.getServerUrl());
	}

	if(pageData.getLocalSavePath()!=null)
	{	
		setLocalSavePath(pageData.getLocalSavePath());
	}

	if(pageData.getStatus()!=null)
	{	
		setStatus(pageData.getStatus());
	}

	if(pageData.getCreateUserId()!=null)
	{	
		setCreateUserId(pageData.getCreateUserId());
	}

	if(pageData.getCreateUser()!=null)
	{	
		setCreateUser(pageData.getCreateUser());
	}

	if(pageData.getCreateTime()!=null)
	{	
		setCreateTime(pageData.getCreateTime());
	}

	if(pageData.getLastUpdateUserId()!=null)
	{	
		setLastUpdateUserId(pageData.getLastUpdateUserId());
	}

	if(pageData.getLastUpdateUser()!=null)
	{	
		setLastUpdateUser(pageData.getLastUpdateUser());
	}

	if(pageData.getLastUdateTime()!=null)
	{	
		setLastUdateTime(pageData.getLastUdateTime());
	}

}

public String getTableName() 
{
	return TABLE_NAME;
}

public String getBackupTableName() 
{
	return BACKUP_TABLE_NAME;
}

public String getBackupSeqName() 
{
	return BACKUP_SEQ_NAME;
}

public java.util.Vector getFields() 
{
	if(m_fields==null)
	{
		m_fields = new Vector();

		m_fields.add(new Field(ID,Value.TYPE_STRING,true,true,32,"ID"));

		m_fields.add(new Field(FILE_TYPE,Value.TYPE_STRING,false,true,30,"�ļ�����"));

		m_fields.add(new Field(FILE_NAME,Value.TYPE_STRING,false,true,100,"�ļ����"));

		m_fields.add(new Field(FILE_LENGTH,Value.TYPE_INT,false,true,0,"�ļ���С"));

		m_fields.add(new Field(VERSION,Value.TYPE_STRING,false,true,20,"�汾��"));

		m_fields.add(new Field(MAJOR,Value.TYPE_INT,false,true,0,"��汾��"));

		m_fields.add(new Field(MINOR,Value.TYPE_INT,false,true,0,"�ΰ汾��"));

		m_fields.add(new Field(REVISION,Value.TYPE_INT,false,true,0,"���а汾��"));

		m_fields.add(new Field(SERVER_URL,Value.TYPE_STRING,false,true,200,"������·��"));

		m_fields.add(new Field(LOCAL_SAVE_PATH,Value.TYPE_STRING,false,true,200,"���ر���·��"));

		m_fields.add(new Field(STATUS,Value.TYPE_STRING,false,true,1,"�Ƿ���Ч"));

		m_fields.add(new Field(CREATE_USER_ID,Value.TYPE_STRING,false,true,32,"���������"));

		m_fields.add(new Field(CREATE_USER,Value.TYPE_STRING,false,true,50,"������"));

		m_fields.add(new Field(CREATE_TIME,Value.TYPE_STRING,false,true,20,"����ʱ��"));

		m_fields.add(new Field(LAST_UPDATE_USER_ID,Value.TYPE_STRING,false,true,32,"����޸������"));

		m_fields.add(new Field(LAST_UPDATE_USER,Value.TYPE_STRING,false,true,50,"����޸���"));

		m_fields.add(new Field(LAST_UDATE_TIME,Value.TYPE_STRING,false,true,20,"����޸�ʱ��"));
	

	}
	return m_fields;
}

public void initObject(java.sql.ResultSet rs) throws Exception
{

	m_ID = getString(rs,ID);

	m_FILE_TYPE = getString(rs,FILE_TYPE);

	m_FILE_NAME = getString(rs,FILE_NAME);

	m_FILE_LENGTH = getInt(rs,FILE_LENGTH);

	m_VERSION = getString(rs,VERSION);

	m_MAJOR = getInt(rs,MAJOR);

	m_MINOR = getInt(rs,MINOR);

	m_REVISION = getInt(rs,REVISION);

	m_SERVER_URL = getString(rs,SERVER_URL);

	m_LOCAL_SAVE_PATH = getString(rs,LOCAL_SAVE_PATH);

	m_STATUS = getString(rs,STATUS);

	m_CREATE_USER_ID = getString(rs,CREATE_USER_ID);

	m_CREATE_USER = getString(rs,CREATE_USER);

	m_CREATE_TIME = getString(rs,CREATE_TIME);

	m_LAST_UPDATE_USER_ID = getString(rs,LAST_UPDATE_USER_ID);

	m_LAST_UPDATE_USER = getString(rs,LAST_UPDATE_USER);

	m_LAST_UDATE_TIME = getString(rs,LAST_UDATE_TIME);

	ms_new_flag = ConstDefine.NO;
}

public Value get(String f)
{

	if(f.equalsIgnoreCase(ID))
	{
		return new Value(getId());
	}

	if(f.equalsIgnoreCase(FILE_TYPE))
	{
		return new Value(getFileType());
	}

	if(f.equalsIgnoreCase(FILE_NAME))
	{
		return new Value(getFileName());
	}

	if(f.equalsIgnoreCase(FILE_LENGTH))
	{
		return new Value(getFileLength());
	}

	if(f.equalsIgnoreCase(VERSION))
	{
		return new Value(getVersion());
	}

	if(f.equalsIgnoreCase(MAJOR))
	{
		return new Value(getMajor());
	}

	if(f.equalsIgnoreCase(MINOR))
	{
		return new Value(getMinor());
	}

	if(f.equalsIgnoreCase(REVISION))
	{
		return new Value(getRevision());
	}

	if(f.equalsIgnoreCase(SERVER_URL))
	{
		return new Value(getServerUrl());
	}

	if(f.equalsIgnoreCase(LOCAL_SAVE_PATH))
	{
		return new Value(getLocalSavePath());
	}

	if(f.equalsIgnoreCase(STATUS))
	{
		return new Value(getStatus());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		return new Value(getCreateUserId());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		return new Value(getCreateUser());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		return new Value(getCreateTime());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		return new Value(getLastUpdateUserId());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		return new Value(getLastUpdateUser());
	}

	if(f.equalsIgnoreCase(LAST_UDATE_TIME))
	{
		return new Value(getLastUdateTime());
	}
	
	return null;
}
public void set(String f,Value v) throws Exception
{

	if(f.equalsIgnoreCase(ID))
	{
		setId(v.getString());
	}

	if(f.equalsIgnoreCase(FILE_TYPE))
	{
		setFileType(v.getString());
	}

	if(f.equalsIgnoreCase(FILE_NAME))
	{
		setFileName(v.getString());
	}

	if(f.equalsIgnoreCase(FILE_LENGTH))
	{
		setFileLength(v.getInt());
	}

	if(f.equalsIgnoreCase(VERSION))
	{
		setVersion(v.getString());
	}

	if(f.equalsIgnoreCase(MAJOR))
	{
		setMajor(v.getInt());
	}

	if(f.equalsIgnoreCase(MINOR))
	{
		setMinor(v.getInt());
	}

	if(f.equalsIgnoreCase(REVISION))
	{
		setRevision(v.getInt());
	}

	if(f.equalsIgnoreCase(SERVER_URL))
	{
		setServerUrl(v.getString());
	}

	if(f.equalsIgnoreCase(LOCAL_SAVE_PATH))
	{
		setLocalSavePath(v.getString());
	}

	if(f.equalsIgnoreCase(STATUS))
	{
		setStatus(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		setCreateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		setCreateUser(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		setCreateTime(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		setLastUpdateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		setLastUpdateUser(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UDATE_TIME))
	{
		setLastUdateTime(v.getString());
	}
	
}
public String toString()
{
	String msg = "DownloadFileVersion=\n";
	msg += "(\r\n";

	msg += "    ID(ID)="+get("ID")+"\r\n";

	msg += "    �ļ�����(FILE_TYPE)="+get("FILE_TYPE")+"\r\n";

	msg += "    �ļ����(FILE_NAME)="+get("FILE_NAME")+"\r\n";

	msg += "    �ļ���С(FILE_LENGTH)="+get("FILE_LENGTH")+"\r\n";

	msg += "    �汾��(VERSION)="+get("VERSION")+"\r\n";

	msg += "    ��汾��(MAJOR)="+get("MAJOR")+"\r\n";

	msg += "    �ΰ汾��(MINOR)="+get("MINOR")+"\r\n";

	msg += "    ���а汾��(REVISION)="+get("REVISION")+"\r\n";

	msg += "    ������·��(SERVER_URL)="+get("SERVER_URL")+"\r\n";

	msg += "    ���ر���·��(LOCAL_SAVE_PATH)="+get("LOCAL_SAVE_PATH")+"\r\n";

	msg += "    �Ƿ���Ч(STATUS)="+get("STATUS")+"\r\n";

	msg += "    ���������(CREATE_USER_ID)="+get("CREATE_USER_ID")+"\r\n";

	msg += "    ������(CREATE_USER)="+get("CREATE_USER")+"\r\n";

	msg += "    ����ʱ��(CREATE_TIME)="+get("CREATE_TIME")+"\r\n";

	msg += "    ����޸������(LAST_UPDATE_USER_ID)="+get("LAST_UPDATE_USER_ID")+"\r\n";

	msg += "    ����޸���(LAST_UPDATE_USER)="+get("LAST_UPDATE_USER")+"\r\n";

	msg += "    ����޸�ʱ��(LAST_UDATE_TIME)="+get("LAST_UDATE_TIME")+"\r\n";
		
	msg += ")\r\n";
	return msg;
}
public void copyBase(DownloadFileVersionBase srcObj)
{

	setFileType(srcObj.getFileType());

	setFileName(srcObj.getFileName());

	setFileLength(srcObj.getFileLength());

	setVersion(srcObj.getVersion());

	setMajor(srcObj.getMajor());

	setMinor(srcObj.getMinor());

	setRevision(srcObj.getRevision());

	setServerUrl(srcObj.getServerUrl());

	setLocalSavePath(srcObj.getLocalSavePath());

	setStatus(srcObj.getStatus());

	setCreateUserId(srcObj.getCreateUserId());

	setCreateUser(srcObj.getCreateUser());

	setCreateTime(srcObj.getCreateTime());

	setLastUpdateUserId(srcObj.getLastUpdateUserId());

	setLastUpdateUser(srcObj.getLastUpdateUser());

	setLastUdateTime(srcObj.getLastUdateTime());

}

public String toXml() throws Exception
{
	String xml = "";
	xml += "<DownloadFileVersion>";

	xml += "<Id>"+Value.view(getId())+"</Id>";

	xml += "<FileType>"+Value.view(getFileType())+"</FileType>";

	xml += "<FileName>"+Value.view(getFileName())+"</FileName>";

	xml += "<FileLength>"+Value.view(getFileLength())+"</FileLength>";

	xml += "<Version>"+Value.view(getVersion())+"</Version>";

	xml += "<Major>"+Value.view(getMajor())+"</Major>";

	xml += "<Minor>"+Value.view(getMinor())+"</Minor>";

	xml += "<Revision>"+Value.view(getRevision())+"</Revision>";

	xml += "<ServerUrl>"+Value.view(getServerUrl())+"</ServerUrl>";

	xml += "<LocalSavePath>"+Value.view(getLocalSavePath())+"</LocalSavePath>";

	xml += "<Status>"+Value.view(getStatus())+"</Status>";

	xml += "<CreateUserId>"+Value.view(getCreateUserId())+"</CreateUserId>";

	xml += "<CreateUser>"+Value.view(getCreateUser())+"</CreateUser>";

	xml += "<CreateTime>"+Value.view(getCreateTime())+"</CreateTime>";

	xml += "<LastUpdateUserId>"+Value.view(getLastUpdateUserId())+"</LastUpdateUserId>";

	xml += "<LastUpdateUser>"+Value.view(getLastUpdateUser())+"</LastUpdateUser>";

	xml += "<LastUdateTime>"+Value.view(getLastUdateTime())+"</LastUdateTime>";
	
	xml += "</DownloadFileVersion>";
	return xml;
}

}
